<?php
/**
 * @package YARBB
 * @copyright Авторские права (C) 2009 www.yar-it.com. Все права защищены.
 * @license Лицензия http://www.gnu.org/licenses/gpl-2.0.htm GNU/GPL, или help/license.php
 * YARBB! - свободное программное обеспечение распространяемое по условиям лицензии GNU/GPL
 * Для получения информации о используемых расширениях и замечаний об авторском праве, смотрите файл copyright.php.
 */
// запрет прямого доступа
defined( '_VALID_MOS' ) or die( 'Прямой доступ запрещен.' );

if (isset($_POST['form_sent'])) {
	$form = array_map('intval', $_POST['form']);
	while (list($key, $input) = @each($form)) {
		// Обновляем настроки
		if (array_key_exists('p_'.$key, $yarbb_config) && $yarbb_config['p_'.$key] != $input)
			$sql = ('UPDATE #__forum_config
						SET conf_value='.$input.' 
						WHERE conf_name=\'p_'.$database->getEscaped($key).'\'');
		$database->setQuery($sql);
		$database->Query($sql);
	}
	// Regenerate the config cache
	require_once $yarbb_admin_path.'/include/cache.php';
	generate_config_cache();
	mosRedirect( 'index2.php?option=com_forum&amp;task=permissions', _CONFIGURATION_IS_UPDATED);
}

?>
<table class="adminheading">
	<tr>
		<th class="menus"> <?php echo _ACCESS_RIGHTS; ?> </th>
	</tr>
</table>
<form method="post" action="<?php echo 'index2.php?option=com_forum&amp;task=permissions' ?>" name="adminForm">
	<input type="hidden" name="task" value="options" />
	<input type="hidden" name="form_sent" value="1" />
	<?php
	$tabs = new mosTabs(1,1);
	$tabs->startPane("configPane");
	$tabs->startTab(_Y_PERPOST, "Posting");
	?>
	<table width="100%" class="adminform">
		<tr>
			<td width="20%"><?php echo _Y_PERBBCODE; ?></td>
			<td width="80%"><input type="radio" name="form[message_bbcode]" value="1"<?php if ($yarbb_config['p_message_bbcode'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[message_bbcode]" value="0"<?php if ($yarbb_config['p_message_bbcode'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong>&nbsp;<?php echo mosToolTip(_Y_PERBBCODE2);?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_PERIMG; ?></td>
			<td ><input type="radio" name="form[message_img_tag]" value="1"<?php if ($yarbb_config['p_message_img_tag'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[message_img_tag]" value="0"<?php if ($yarbb_config['p_message_img_tag'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong>&nbsp;<?php echo mosToolTip(_Y_PERIMG2);?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_PERPROP; ?></td>
			<td><input type="radio" name="form[message_all_caps]" value="1"<?php if ($yarbb_config['p_message_all_caps'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[message_all_caps]" value="0"<?php if ($yarbb_config['p_message_all_caps'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong>&nbsp;<?php echo mosToolTip(_Y_PERPROP2);?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_PERCAPTOP; ?></td>
			<td><input type="radio" name="form[subject_all_caps]" value="1"<?php if ($yarbb_config['p_subject_all_caps'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[subject_all_caps]" value="0"<?php if ($yarbb_config['p_subject_all_caps'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong>&nbsp;<?php echo mosToolTip(_Y_PERCAPTOP2);?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_PEREMAIL; ?></td>
			<td><input type="radio" name="form[force_guest_email]" value="1"<?php if ($yarbb_config['p_force_guest_email'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[force_guest_email]" value="0"<?php if ($yarbb_config['p_force_guest_email'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong>&nbsp;<?php echo mosToolTip(_Y_PEREMAIL2);?>
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	$tabs->startTab(_Y_PERSIG, "Signatures");
	?>
	<table width="100%" cellspacing="0" class="adminform">
		<tr>
			<td width="20%"><?php echo _Y_PERBBCODE; ?></td>
			<td width="80%"><input type="radio" name="form[sig_bbcode]" value="1"<?php if ($yarbb_config['p_sig_bbcode'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[sig_bbcode]" value="0"<?php if ($yarbb_config['p_sig_bbcode'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_PERBBCODESIG); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_PERIMG; ?></td>
			<td><input type="radio" name="form[sig_img_tag]" value="1"<?php if ($yarbb_config['p_sig_img_tag'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[sig_img_tag]" value="0"<?php if ($yarbb_config['p_sig_img_tag'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_PERIMGSIG); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_PERCAPSIG; ?></td>
			<td><input type="radio" name="form[sig_all_caps]" value="1"<?php if ($yarbb_config['p_sig_all_caps'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[sig_all_caps]" value="0"<?php if ($yarbb_config['p_sig_all_caps'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_PERCAPSIG2); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_PERMLONG; ?></td>
			<td><input type="text" name="form[sig_length]" size="5" maxlength="5" value="<?php echo $yarbb_config['p_sig_length'] ?>" />
				<span><?php echo mosToolTip(_Y_PERMLONG2); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_PERSTROK; ?></td>
			<td><input type="text" name="form[sig_lines]" size="3" maxlength="3" value="<?php echo $yarbb_config['p_sig_lines'] ?>" />
				<span><?php echo mosToolTip(_Y_PERSTROK2); ?></span>
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	$tabs->startTab(_Y_PERMODER, "Moderators");
	?>
	<table width="100%" cellspacing="0" class="adminform">
		<tr>
			<td width="20%"><?php echo _Y_PEREDITUSR; ?></td>
			<td width="80%"><input type="radio" name="form[mod_edit_users]" value="1"<?php if ($yarbb_config['p_mod_edit_users'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[mod_edit_users]" value="0"<?php if ($yarbb_config['p_mod_edit_users'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_PEREDITUSR2); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_PERIZUSR; ?></td>
			<td><input type="radio" name="form[mod_rename_users]" value="1"<?php if ($yarbb_config['p_mod_rename_users'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[mod_rename_users]" value="0"<?php if ($yarbb_config['p_mod_rename_users'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_PERIZUSR2); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_BANS; ?></td>
			<td><input type="radio" name="form[mod_ban_users]" value="1"<?php if ($yarbb_config['p_mod_ban_users'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[mod_ban_users]" value="0"<?php if ($yarbb_config['p_mod_ban_users'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_PERMDESCBAN); ?></span>
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	?>
</form>